package xyz.eden.boot.common.web.support.infrastructure.publish.enums;

import lombok.Getter;

/**
 * EventTypeEnum.
 */
@Getter
public enum EventTypeEnum {

    // ============== created ===================
    /**
     * created event.
     */
    CREATE(DataEventTypeEnum.CREATE, Color.CREATE_COLOR),

    // ============== delete ===================
    /**
     * deleted event.
     */
    DELETE(DataEventTypeEnum.DELETE, Color.DELETE_COLOR),
    // ============== update ===================
    /**
     * update event.
     */
    UPDATE(DataEventTypeEnum.UPDATE, Color.UPDATE_COLOR);

    /**
     * type name.
     */
    private final String typeName;

    /**
     * type.
     */
    private final DataEventTypeEnum type;

    /**
     * color.
     */
    private final String color;

    EventTypeEnum(final DataEventTypeEnum type, final String color) {
        this(type.toString(), type, color);
    }

    EventTypeEnum(final String typeName, final DataEventTypeEnum type, final String color) {
        this.typeName = typeName;
        this.type = type;
        this.color = color;
    }

    /**
     * default color.
     */
    private static class Color {
        /**
         * default create event color.
         */
        public static final String CREATE_COLOR = "green";

        /**
         * default delete event color.
         */
        public static final String DELETE_COLOR = "red";

        /**
         * default update event color.
         */
        public static final String UPDATE_COLOR = "#CC6600";
    }

}
